I wrote a dxl script which will automate the Export to word. Now I want dxl script to edit the existing instance of word to update the exported document to 'web layout' and 'auto fit to window'.
DB theDiag = null
void connectToWord()
{
checkPlatform "Microsoft Word"
app = connectToApp(cObjWordApplication, "Word")
if (null app)
{
ack "Falied to create word application"
halt
}
.....
//what is the ole to change to web layout
}
// Now override block and show, to only do realize
void show (DB x) { realize x; theDiag = x }
void block (DB x) { realize x; theDiag = x }
if (null current Module) {
print "Kindly select DOORs module for the export."
halt
}
#include <standard/export/office/word.dxl>
// Dialog optins of itfui2.inc and word.dxl can be overwritten
set(exportLayoutChoice, layoutTypeTable) // layout selected as table
//Invoke Export to Word dialog
doExport theDiag
// destroy the dialog
if (!null theDiag) destroy theDiag
connectToWord()
DXLScripter - Fri Jan 11 08:27:34 EST 2013 |
Re: Edit exported word document
Here is the updated code
#include <C:\Program Files\Telelogic\DOORS_8.3\lib\dxl\utils\ole.inc>
DB theDiag = null
void connectToWord()
{
const string cPropertyCustomDocumentProperties = "CustomDocumentProperties"
OleAutoArgs objArgBlock
OleAutoObj objWord
OleAutoObj objDoc
OleAutoObj objCustomProperties = null
OleAutoObj objProperty = null
// Need OLE argument block
objArgBlock = create
// (Re-)attach to existing word application
objWord = oleGetAutoObject(cObjWordApplication)
// Get Active Document
checkRes(oleGet (objWord, cPropertyActiveDocument, objDoc))
// Get CustomProperties Collection
checkRes(oleGet (objDoc, cPropertyCustomDocumentProperties, objCustomProperties))
//Need Code to change to web layout
//Need Code to auto fit to window
}
// Now override block and show, to only do realize
void show (DB x) { realize x; theDiag = x }
void block (DB x) { realize x; theDiag = x }
if (null current Module) {
print "Kindly select DOORs module for the export."
halt
}
{
#include <standard/export/office/word.dxl>
// Dialog optins of itfui2.inc and word.dxl can be overwritten
set(exportLayoutChoice, layoutTypeTable) // layout selected as table
//Invoke Export to Word dialog
doExport theDiag
// destroy the dialog
if (!null theDiag) destroy theDiag
}
connectToWord()
|
Re: Edit exported word document DXLScripter - Fri Jan 11 09:30:49 EST 2013
Here is the updated code
#include <C:\Program Files\Telelogic\DOORS_8.3\lib\dxl\utils\ole.inc>
DB theDiag = null
void connectToWord()
{
const string cPropertyCustomDocumentProperties = "CustomDocumentProperties"
OleAutoArgs objArgBlock
OleAutoObj objWord
OleAutoObj objDoc
OleAutoObj objCustomProperties = null
OleAutoObj objProperty = null
// Need OLE argument block
objArgBlock = create
// (Re-)attach to existing word application
objWord = oleGetAutoObject(cObjWordApplication)
// Get Active Document
checkRes(oleGet (objWord, cPropertyActiveDocument, objDoc))
// Get CustomProperties Collection
checkRes(oleGet (objDoc, cPropertyCustomDocumentProperties, objCustomProperties))
//Need Code to change to web layout
//Need Code to auto fit to window
}
// Now override block and show, to only do realize
void show (DB x) { realize x; theDiag = x }
void block (DB x) { realize x; theDiag = x }
if (null current Module) {
print "Kindly select DOORs module for the export."
halt
}
{
#include <standard/export/office/word.dxl>
// Dialog optins of itfui2.inc and word.dxl can be overwritten
set(exportLayoutChoice, layoutTypeTable) // layout selected as table
//Invoke Export to Word dialog
doExport theDiag
// destroy the dialog
if (!null theDiag) destroy theDiag
}
connectToWord()
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS |
Re: Edit exported word document Mathias Mamsch - Fri Jan 11 12:24:06 EST 2013 Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
I did try to match the VBA to dxl but unfortunately I did not get the code to Autofit to window
objArgBlock = create
objWord = oleGetAutoObject(cObjWordApplication)
checkRes(oleGet (objWord, cPropertyActiveDocument, objDoc))
oleGet(objWord,"ActiveWindow", objWindow)
olePut(objWindow, "View", 6) //Code to change to web layout
oleGet(objDoc, cPropertyTables, objTables)
clear(objArgBlock)
put(objArgBlock, 1)
oleMethod(objTables, "Item", objArgBlock, objTable)
olePut(objTable, "AutoFitBehavior", 2) //Code to auto fit to window
|
Re: Edit exported word document Hi,
I have used your script for automating the export to word. For my requirement, i need to export some portion of the module in Book format and another portion of the module in Table format ti Word. I am facing issue in appending the table format to the first doument. Can you please help me export the same module from doors, into book and Table format in a single word doc? |